package org.example.authservice.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import jakarta.persistence.Id;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;
/**
 * @author 浦慧慧
 * @since 2024/12/15 11.34
 * @version 1.0
 */
@Data
public class Permission {
    /**
     * id主键
     * parentId父权限id
     * name权限名称
     * sort排序
     * type权限类型
     * path权限路径
     * comment备注
     * icon图标
     * url权限url
     * code权限编码
     * children子权限
     * value权限值
     * label权限标签
     */
    @Id
    @TableId(value="id",type= IdType.AUTO)
    private Integer id;
    private Integer parentId;
    private String name;
    private Integer sort;
    private Integer type;
    private String path;
    private String comment;
    private String icon;
    private String url;
    private String code;
    @TableField(exist = false)
    private List<Permission> children = new ArrayList<>();
    @TableField(exist = false)
    private Integer value;
    @TableField(exist = false)
    private String label;
}
